#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdio.h>
#include <cstring>
using namespace std;
void  sort( const char* alpha[5], int n,int arr[])
{
	int i = 0;
	int j = 0;
	for (i; i < n-1; i++)
	{
		for (j = 0; j < n-i-1; j++)
		{
			if (strcmp(alpha[arr[j]],alpha[arr[j+1]])>0)
			{
				int tmp = arr[j + 1];
				arr[j + 1] = arr[j];
				arr[j] = tmp;
			}
		}
	}
}
void  print(const char* alpha[5], int n,int arr[])
{
	int i = 0;
	for (i; i < n; i++)
	{
		cout << alpha[arr[i]];
		if (i != 4)
			cout << endl;
	}
}

int main()
{
	int arr[5] = { 0,1,2,3,4 };
    const char* alpha[5] = { "Follow me","Basic", "Great Wall","FORTRAN", "Computer design" };
	int n = 5;
	sort(alpha, n,arr);
	print(alpha, n,arr);
	return 0;
}